﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/MasterMng.master" AutoEventWireup="true" CodeFile="AssignTask.aspx.cs" Inherits="ExpertManager_AssignTask" %>
<%@ Register Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" tagPrefix="cc" %>
<%@ Register assembly="AjaxControlToolkit" 
             namespace="AjaxControlToolkit" tagprefix="asp" %>
<%@ Register assembly="ProudMonkey.Common.Controls"
             namespace="ProudMonkey.Common.Controls" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Header1" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    
   <table bgcolor="#CCCCFF" style="width: 100%">
        <tr>
            <td align="center" colspan="4">
                <asp:Image ID="Image1" runat="server"  ImageUrl="~/Images/Task.png" 
                    Width="15%"/>
            </td>
        </tr>
        <tr>
            <td align="center" bgcolor="#9966FF" colspan="4">
                <asp:Label ID="Label1" runat="server" Font-Size="14px" ForeColor="#FFFF99" 
                    Text="تخصیص وظایف به کارشناسان"></asp:Label>
            </td>
        </tr>
        <tr>
         
            <td>
                &nbsp;</td>
            <td style="width: 634px">
             <cc1:ConfirmBox ID="Confirm1" runat=server />
            </td>
            <td align="right">
                <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
                    DataSourceID="SqlDataProvinces" DataTextField="ProvinceName" 
                    DataValueField="ID" onselectedindexchanged="DropDownList1_SelectedIndexChanged">
                </asp:DropDownList>
            </td>
            <td align="left">
                <asp:Label ID="Label2" runat="server" Text=":نام شهرستان"></asp:Label>
            </td>
        </tr>
        <tr>
            <td align="left" colspan="4" style="height: 17px">
                <%--  
                </asp:UpdatePanel>
                </ContentTemplate>
                
                --%>
                   
                    <asp:SqlDataSource ID="SubCategory" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:CON %>" 
                    ProviderName="System.Data.SqlClient" 
                    SelectCommand="SELECT [Telephone], [ID],[IsDone] FROM [CustCustFolder] WHERE ([ProvinceId] = @ProvinceId) AND ([IsDone] = 0)" >
                        <SelectParameters>
                            <asp:ControlParameter ControlID="DropDownList1" Name="ProvinceId" 
                                PropertyName="SelectedValue" Type="Int32" />
                        </SelectParameters>
                </asp:SqlDataSource>
                     <asp:SqlDataSource ID="SqlDataProvinces" runat="server" 
                         ConnectionString="<%$ ConnectionStrings:CON %>" 
                         ProviderName="System.Data.SqlClient" 
                         SelectCommand="SELECT [ProvinceName], [ID] FROM [TblProvince]">
                     </asp:SqlDataSource>
                <asp:GridView Width="45%"  runat="server"
                Id="gvcustomer" AutoGenerateColumns="False" OnRowCommand="gvcus_RowCommand"
                GridLines="None" ShowHeader="False" OnRowCreated="gvCust_RowCreated"
                DataKeyNames="Telephone" DataSourceID="SubCategory">
                <Columns>
                <asp:ButtonField Text="ارسال برای کارشناس" CommandName="Assign"/>
                <asp:BoundField DataField="ID" />
                <asp:TemplateField>
                <ItemTemplate>
                <asp:Panel runat="server" ID="PnlCus">
                <asp:Image ID="ImgColl" style="margin-right:5px; width:11%" runat="server" />
                <span style="font-weight:bold"><%#Eval("Telephone")%></span>
                </asp:Panel>
               <asp:SqlDataSource ID="SqlCustomer" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:CON %>" 
                    ProviderName="System.Data.SqlClient" 
                    SelectCommand="SELECT [Name], [Family], [Address], [Mobile], [Telephone], [RegDate] FROM [CustCustFolder] WHERE ([Telephone] = @Telephone)" >
                 <SelectParameters>
                 <asp:Parameter Name="Telephone" Type="String" />
                 
                 </SelectParameters>
                  </asp:SqlDataSource> 
                <asp:Panel ID="PnlGet" runat="server" Width="45%" >
               <asp:GridView runat="server" ID="GrdGet" AutoGenerateColumns="false" 
                 DataSourceID="SqlCustomer" EnableViewState="false" 
                 GridLines="Vertical" BorderColor="#0033CC" BackColor="#9999FF"  ForeColor="White" HeaderStyle-ForeColor="#33CCFF" HeaderStyle-BackColor="#003366">
                <Columns>
                 <asp:BoundField  HeaderText="نام مشتری" DataField="Name" />
                 <asp:BoundField  HeaderText="نام خانوادگی مشتری" DataField="Family" />
                 <asp:BoundField  HeaderText="آدرس" DataField="Address" />
                 <asp:BoundField  HeaderText="شماره موبایل" DataField="Mobile" />
                 <asp:BoundField  HeaderText="شماره تلفن" DataField="Telephone" />
                 <asp:BoundField  HeaderText="تاریخ ثبت نام" DataField="RegDate" />
                </Columns>
                </asp:GridView>
                </asp:Panel> 
                <cc:CollapsiblePanelExtender 
                Id="ctlCollapse" runat="server"
                TargetControlID="PnlGet" CollapsedSize="0" Collapsed="true"
                 ExpandControlID="PnlCus" 
                 CollapseControlID="PnlCus"
                 AutoCollapse="false" AutoExpand="false" ScrollContents="false"
                 ImageControlID="ImgColl" ExpandedImage="~/Images/Collapse.png" CollapsedImage="~/Images/E.png"
                 ExpandDirection="Vertical">
                
                </cc:CollapsiblePanelExtender>
                </ItemTemplate>
                </asp:TemplateField>
                             
                </Columns>
                
                </asp:GridView>
              <%--  </ContentTemplate>
                
                </asp:UpdatePanel>--%>
                
                </td>
        </tr>
        <tr>
            <td align="center" colspan="4" style="height: 17px">
                &nbsp;</td>
        </tr>
        <tr>
            <td style="height: 17px">
                &nbsp;</td>
            <td style="height: 17px; width: 634px;">
                <asp:MultiView ID="MultiView1" runat="server">
                    <asp:View ID="View1" runat="server">
                        <asp:Panel ID="PnlTask2" runat="server" 
                         BackColor="#9999FF">
                            <table style="width: 100%">
                                <tr>
                                    <td style="width: 251px">
                                        &nbsp;</td>
                                    <td align="right" colspan="2">
                                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                                            ConnectionString="<%$ ConnectionStrings:CON %>" 
                                            ProviderName="System.Data.SqlClient" 
                                            SelectCommand="SELECT [ID], [Name] FROM [TblExperts]"></asp:SqlDataSource>
                                    </td>
                                    <td>
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td style="width: 251px">
                                        &nbsp;</td>
                                    <td align="right">
                                        <asp:DropDownList ID="DrpExpert" runat="server" DataSourceID="SqlDataSource1" 
                                            DataTextField="Name" DataValueField="ID">
                                        </asp:DropDownList>
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="Label3" runat="server" Text=":تعیین کارشناس"></asp:Label>
                                    </td>
                                    <td>
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td style="width: 251px" align="right">
                                        &nbsp;</td>
                                    <td align="right">
                                        <asp:TextBox ID="Txtime" runat="server" Enabled="False"></asp:TextBox>
                                   
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="Label4" runat="server" 
                Text=":زمان تخصیص به کارشناس"></asp:Label>
                                        &nbsp; &nbsp;</td>
                                    <td>
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td style="width: 251px">
                                        &nbsp;</td>
                                    <td align="right">
                                        <asp:DropDownList ID="DrpType" runat="server">
                                        </asp:DropDownList>
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="Label5" runat="server" Text=":نوع مشکل"></asp:Label>
                                    </td>
                                    <td>
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td style="width: 251px">
                                        &nbsp;</td>
                                    <td align="right">
                                        <asp:TextBox ID="TxDesc" runat="server" 
                                    TextMode="MultiLine"></asp:TextBox>
                                    </td>
                                    <td align="left">
                                        <asp:Label ID="Label6" runat="server" Text="توضیحات"></asp:Label>
                                    </td>
                                    <td>
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td style="width: 251px" align="right">
                                        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" 
                                            Text="انتخاب مجدد مشتری" />
                                    </td>
                                    <td align="right">
                                        <asp:Button ID="BtnOk" runat="server" onclick="BtnOk_Click" 
                                   OnClientClick="ShowConfirmBox(this,'آیا از  ارسال به کارشناس مطمینید'); return false;" 
                                    Width="165px" Text="ارسال به کارشناس"  />
                                    </td>
                                    <td align="left">
                                        &nbsp;</td>
                                    <td>
                                        &nbsp;</td>
                                </tr>
                            </table>
                        </asp:Panel>
                    </asp:View>
                </asp:MultiView>
            </td>
            <td align="right" style="height: 17px">
                &nbsp;</td>
            <td align="left" style="height: 17px">
                &nbsp;</td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Header" Runat="Server">
</asp:Content>

